
class Solution {
    public int removeDuplicates(int[] nums) {
        int q = 2;
        for(int i = 2;i<nums.length;i++)
        {
            if(nums[q-2]!=nums[i])
            {
                nums[q] = nums[i];
                q++;
            }
        }
        return q;
    }
}
public class demo2 {
    public static void main(String[] args) {

    }
}
